(library (priority-search-queues)
  (export psq->list)
  (import
   (except (rnrs base)
           let-values
           map
           error
           vector-map)
   (only (guile)
         lambda* λ)
   ;; let-values
   (srfi srfi-11)
   ;; functional priority search queues
   (pfds psqs))

  (define psq->list
    (λ (queue)
      (cond
       [(psq-empty? queue) '()]
       [else
        (let-values ([(min-key popped-queue) (psq-pop queue)])
          (cons min-key
                (psq->list popped-queue)))]))))
